﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.ScGetWMSTaskDomain;
using Zocono.WCS.Domain.WorkTaskDomain;
using Zocono.WCS.Infrastructure.ApllicationDto;
using Zocono.WCS.Infrastructure.ApllicationDto.WCSTaskDto;
using Zocono.WCS.Infrastructure.ApllicationDto.WmsModel;


namespace Zocono.WCS.Application.AppConfigureManage
{
    public class HistoryWorkTaskInfoApp
    {
        private readonly ILogUtil _LogUtil;
        private readonly IHistoryWorkTaskInfoServeice _WorkTaskInfoServeice;
        public HistoryWorkTaskInfoApp(ILogUtil logUtil, IHistoryWorkTaskInfoServeice workTaskInfoServeice)
        {
            _LogUtil = logUtil;
            _WorkTaskInfoServeice = workTaskInfoServeice;
        }

        public async Task<PageDto<HistoryWorkTaskInfoDto>> GetPagedWorkTaskInfoAsync(QueryHistoryWorkTaskInfoDto queryWorkTaskInfoDto)
        {
            try
            {
                return await _WorkTaskInfoServeice.GetPagedWorkTaskInfoAsync(queryWorkTaskInfoDto);
            }
            catch (Exception ex)
            {
                _LogUtil.Error($"获取历史任务报错ex={ex.ToString()}");
                return null;
            }
        }

        public async Task<PageDto<HistoryWorkTaskInfoDto>> GetPagedCurrentWorkTaskInfoAsync(QueryHistoryWorkTaskInfoDto queryWorkTaskInfoDto)
        {
            return await _WorkTaskInfoServeice.GetPagedCurrentWorkTaskInfoAsync(queryWorkTaskInfoDto);
        }

        public async Task<bool> BackSetTaskAsync(long id)
        {
            return await _WorkTaskInfoServeice.BackSetTaskAsync(id);
        }
        
        
    }
}
